package base.annotation.cls.track;

import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import base.annotation.UseCase;
import base.annotation.cls.PasswordUtils;

public class UseCaseTracker {
	
	public static void trackUseCases(List<Integer> useCases,Class<?> cls){
		for(Method m:cls.getDeclaredMethods()){
			UseCase uc=m.getAnnotation(UseCase.class);
			if(uc!=null){
				System.out.println("Found use case "+ m.getName()+" :"+uc.id()+" "+uc.description());
			}else{
				
			}
		}
		for(int i:useCases){
			System.out.println("Warning:Missing use case-"+i);
		}
	}
	
	public static void main(String[] args) {
		
		List<Integer> useCases=new ArrayList<Integer>();
		Collections.addAll(useCases, 47,48,49,50);
		
		trackUseCases(useCases, PasswordUtils.class);
	}
	
}
